package DataStructure.Map;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

public class HashMap_01 {


    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {

        Map map = new java.util.HashMap<>();

        for(int i = 0 ; i < 10 ; i++){

                map.put(i,i);

        }

        Class<?> class1 = HashMap.class;

        Field table01 = class1.getDeclaredField("table"); //通过名称获取属性

        table01.setAccessible(true); //把该属性设置为可访问
        Node_01[] field_01 = (HashMap.Node[]) table01.get(map);//获取该类指定对象的该属性值


        for(int i = 0 ; i < 10 ; i++){

            System.out.println(field_01[i]);

        }


    }



}
